import { createRouter, createWebHistory } from 'vue-router'
import indexView from "@/views/indexView";

const routes = [
  {
    path: '/',
    name: 'indexView',
    component: indexView
  },
  {
    path: '/product/list',
    name: 'productListView',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/productListView.vue')
  },
  {
    path: '/user/register',
    name: 'RegisterView',
    component: () => import('../views/RegisterView.vue')
  },
  {
    path: '/user/center',
    name: 'UserCenterView',
    component: () => import('../views/UserCenterView.vue')
  },
  {
    path: '/user/login',
    name: 'LoginView',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/user/recharge',
    name: 'UserRechargeView',
    component: () => import('../views/UserRechargeView.vue')
  },
  {
    path: '/user/realname',
    name: 'RealNameView',
    component: () => import('../views/RealNameView.vue')
  },
  {
    path: '/product/details',
    name: 'DetailsView',
    component: () => import('../views/ProductDetailsView.vue')
  },
  {
    path: '/pay/result',
    name: 'PayResultView',
    component: () => import('../views/PayResultView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
